#pragma once

#include <utility>

namespace solution_062
{

class Solution
{
public:
    int uniquePaths(int m, int n)
    {
        --m;
        --n;
        if (m > n)
            std::swap(m, n);
        n += m;
        long long num = 1;
        for (int i = n; i > n - m; --i)
            num *= i;
        for (int i = 2; i <= m; ++i)
            num /= i;
        return num;
    }
};

}  /* namespace solution_062 */
